package com.woniu.controller;

import com.woniu.constant.HttpStatus;
import com.woniu.entity.PageData;
import com.woniu.entity.Result;
import com.woniu.service.InspectorService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;

@RestController
@RequestMapping("parkingRecordsController")
public class ParkingRecordsController {

    @Resource
    private InspectorService inspectorService;

    @ApiOperation("停车记录")
    @GetMapping("/page")
        public Result parkingRecords(String inspectorId, @RequestParam(value="startTime",required=false)Date startTime , @RequestParam(value="endTime",required=false)Date endTime, Integer currentPage, Integer pageSize){
            PageData pageData = inspectorService.findParkingRecords(inspectorId,startTime,endTime,currentPage,pageSize);
            return new Result(HttpStatus.SUCCESS,"查询成功",pageData);
    }


}
